package cn.wubo.multi.thread.demo01;

import java.util.stream.IntStream;

/**
 * Thread 实现了Runnable接口并进行了扩展
 */
public class Demo0102 {

    public static void main(String[] args) {
        IntStream.range(0, 10).forEach(i -> new Thread(() ->{
            //等待一会
            try {
                Thread.sleep((int) (Math.random() * 100));
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName());
        }).start());
    }
}
